﻿using System.Windows;
using Microsoft.Phone.Controls;

namespace ExchangeExample.WP7
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            DataContext = App.MainViewModel;

            Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            Deployment.Current.Dispatcher.BeginInvoke(
            delegate
            {
                App.MainViewModel.UpdateData();
            });
            
        }
    }
}